<template>
  <a-drawer
    width="576"
    :title="formTitle"
    :label-col="4"
    :wrapper-col="14"
    :visible="open"
    :body-style="{height:'calc(100vh - 100px)',overflow:'auto'}"
    @close="cancel">
    <a-form-model ref="form" :model="form" :rules="rules" layout="vertical">
      <a-spin :spinning="spinning" :delay="delayTime" tip="Loading...">
        <a-row :gutter="32">
          <a-col :span="12">
            <a-form-model-item label="用户" prop="userId">
              <select-user v-model="form.userId" select-model="single" placeholder="请选择用户" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="地区" prop="regionId">
              <select-region v-model="form.regionId" placeholder="请选择地区" />
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item label="发帖数" prop="publishPostNumber">
              <a-input-number v-model="form.publishPostNumber" :min="0" style="width: 100%"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item label="发评数" prop="publishCommentNumber">
              <a-input-number v-model="form.publishCommentNumber" :min="0" style="width: 100%"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item label="浏览数" prop="postNumber">
              <a-input-number v-model="form.postNumber" :min="0" style="width: 100%"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item label="评论数" prop="commentNumber">
              <a-input-number v-model="form.commentNumber" :min="0" style="width: 100%"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item label="点赞数" prop="likeNumber">
              <a-input-number v-model="form.likeNumber" :min="0" style="width: 100%"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item label="收藏数" prop="collectNumber">
              <a-input-number v-model="form.collectNumber" :min="0" style="width: 100%"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item label="被评论数" prop="beCommentNumber">
              <a-input-number v-model="form.beCommentNumber" :min="0" style="width: 100%"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item label="被赞数" prop="beLikeNumber">
              <a-input-number v-model="form.beLikeNumber" :min="0" style="width: 100%"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item label="被收藏数" prop="beCollectNumber">
              <a-input-number v-model="form.beCollectNumber" :min="0" style="width: 100%"/>
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-spin>
      <div class="bottom-control">
        <a-space>
          <a-button :disabled="disabled" @click="cancel">
            取消
          </a-button>
          <a-button type="primary" :disabled="disabled" @click="submitForm(true)">
            保存
          </a-button>
        </a-space>
      </div>
    </a-form-model>
  </a-drawer>
</template>
<script>
import UserRecordEditForm from './UserRecordForm'
export default {
  ...UserRecordEditForm
}
</script>
